package cn.mumzone.pos.ui.adapter;

import android.content.Context;

import cn.mumzone.basic.adapter.rv.CommonAdapter;
import cn.mumzone.basic.adapter.rv.ViewHolder;
import cn.mumzone.basic.util.StringUtils;
import cn.mumzone.pos.R;
import cn.mumzone.pos.util.print.PrintPayTypeEntity;

/**
 * Created by qiuzhenhuan on 2019/11/18.
 */

public class ADA_ReturnMoneyDetail extends CommonAdapter<PrintPayTypeEntity> {

    private Context mContext;

    public ADA_ReturnMoneyDetail(Context context) {
        super(context);
        this.mContext = context;
    }

    @Override
    protected int itemLayoutId() {
        return R.layout.item_return_money;
    }

    @Override
    protected void convert(ViewHolder holder, PrintPayTypeEntity printPayTypeEntity, int position) {
        holder.setText(R.id.tv_name, StringUtils.get(printPayTypeEntity.getName()));
        holder.setText(R.id.tv_money, StringUtils.get(printPayTypeEntity.getAmount()));
        if (position == 0) {
            holder.setTextColor(R.id.tv_name, mContext.getResources().getColor(R.color.title_text_color));
            holder.setTextColor(R.id.tv_money, mContext.getResources().getColor(R.color.title_text_color));
        } else {
            holder.setTextColor(R.id.tv_name, mContext.getResources().getColor(R.color.weak_text_color));
            holder.setTextColor(R.id.tv_money, mContext.getResources().getColor(R.color.weak_text_color));
        }
    }
}
